<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <head>
    </head>
    <body>
        <ui:composition template="/MenuTemplate_wave.xhtml">
             <ui:define name="content_nav">
                   #{msg.content_nav_motormanage}
                </ui:define>
            <ui:define name="content">
                <h:form  id="motorSearchForm">
                <h:panelGrid  styleClass="body_content_box" columns="1">
                        <h:panelGrid styleClass="search_border" columns="1" cellpadding="0" cellspacing="0">
                            <h:panelGrid styleClass="search_title" columns="1" cellpadding="0"
                                         cellspacing="2">
                                <h:outputLabel value="#{msg.content_title_motor_book}"  style="vertical-align: middle"/>
                            </h:panelGrid>
                           
                            <h:panelGrid columns="3" style="width: 100%" cellpadding="0" border="0" cellspacing="6">
                                <h:panelGrid columnClasses="com_width_50,com_width_75,com_width_25" columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_driver_name}" styleClass="com_label_blue"></h:outputLabel>
                                    <h:inputText value="#{motorBookListBean.driverName}"></h:inputText>
                                    <h:outputLabel />
                                </h:panelGrid>
                                <h:panelGrid columnClasses="com_width_50,com_width_175,com_width_25" columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_motor_search_date}" styleClass="com_label_blue"></h:outputLabel>
                                     <t:inputCalendar value="#{motorBookListBean.searchDate}" renderAsPopup="true" popupDateFormat="yyyy-MM-dd" helpText="YYYY-MM-DD"
                                                         popupButtonString="..." popupTheme="WH"/>
                                     <h:outputLabel />
                                </h:panelGrid>
                                <h:panelGrid columnClasses="com_width_50,com_width_50,com_width_125" columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_motor_domain}" styleClass="com_label_blue"></h:outputLabel>
                                    <h:selectOneMenu value="#{motorBookListBean.domainId}">
                                        <f:selectItems value="#{motorBookListBean.domainList}"/>
                                    </h:selectOneMenu>
                                    <h:outputLabel />
                                </h:panelGrid>
                            </h:panelGrid>
                        
                            <h:panelGrid cellspacing="0" cellpadding="0" columns="5">
                                   <h:commandButton value="#{msg.bt_search}" action="#{motorBookListBean.refreshData}"/>
                                    <h:commandButton value="#{msg.bt_reset}" action="#{motorBookListBean.reset}"/>
                           </h:panelGrid>
                        </h:panelGrid>
                    </h:panelGrid>
                 </h:form>
                <h:messages globalOnly="true" infoClass="info"  errorClass="alert" fatalClass="colorOrange" />
                <h:form id ="dataForm">
            <h:panelGrid  styleClass="body_content_box" columns="1">
                <h:panelGrid styleClass="table_border" columns="1" cellpadding="0" cellspacing="0">
                    <h:panelGrid styleClass="table_title" columns="1" cellpadding="0"
                                 cellspacing="2">
                        <h:outputLabel value="#{motorBookListBean.tableTitle}"  style="vertical-align: middle"/>
                    </h:panelGrid>
                    <t:dataTable id="dataTable" value="#{motorBookListBean.data}"
                                 var="row" rows="#{motorBookListBean.pageInfo.pageSize}"
                                 headerClass="table_header"
                                 styleClass="mxl"
                                 rowClasses="list-row1-background,list-row2-background"
                                 >
                        <t:column style="width:2%" rendered="#{motorBookListBean.multiSelectable}">
                            <f:facet name="header">
                                <h:selectBooleanCheckbox id="multiSelected"
                                                         value="#{motorBookListBean.allSelected}"
                                                         rendered="#{motorBookListBean.multiSelectable}"
                                                         onclick="SetCheckedStatus()">
                                </h:selectBooleanCheckbox>
                            </f:facet>
                            <h:selectBooleanCheckbox value="#{motorBookListBean.selected}"
                                                     rendered="#{motorBookListBean.multiSelectable}"
                                                     onchange="submit()"
                                                     onclick="CheckAll()">
                            </h:selectBooleanCheckbox>
                        </t:column>
                        <t:columns value="#{motorBookListBean.headerColumns}" var="headerRow" width="#{headerRow.width}">
                            <f:facet name="header">
                                <h:outputText value="#{headerRow.columnText}" />
                            </f:facet>
                            <h:outputText value="#{motorBookListBean.columnValue}"/>
                        </t:columns>
                        <t:column width="5%" rendered="#{!userLoginBean.normal}">
                            <f:facet name="header">
                                <h:outputText/>
                            </f:facet>
                            <h:commandLink action="#{motorBookListBean.bookMotor}" value="#{msg.lnk_book}"/>
                        </t:column>
                        <t:column width="5%">
                            <f:facet name="header">
                                <h:outputText/>
                            </f:facet>
                            <h:commandLink action="#{motorBookListBean.showDetail}" value="#{msg.lnk_view}"/>
                        </t:column>
                    </t:dataTable>
                    <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                        <t:dataScroller id="scroll" for="dataTable" rowsCountVar="#{motorBookListBean.pageInfo.totalCount}"
                                        displayedRowsCountVar="#{motorBookListBean.pageInfo.displayCount}"
                                        pageCountVar="#{motorBookListBean.pageInfo.totalPages}"
                                        pageIndexVar="#{motorBookListBean.pageInfo.currentPage}"
                                        rendered="#{motorBookListBean.pagable}"
                                        actionListener="#{motorBookListBean.scrollAction}">
                            <f:facet name="first" >
                                <h:outputText value="第一页"/>
                            </f:facet>
                            <f:facet name="last">
                                <h:outputText value="最后页"/>
                            </f:facet>
                            <f:facet name="previous">
                                <h:outputText value="上一页"/>
                            </f:facet>
                            <f:facet name="next">
                                <h:outputText value="下一页"/>
                            </f:facet>
                        </t:dataScroller>
                        <h:outputFormat value="总记录数({0}), 第({1})页/共({2})页" styleClass="standard" >
                            <f:param value="#{motorBookListBean.pageInfo.totalCount}" />
                            <f:param value="#{motorBookListBean.pageInfo.currentPage}" />
                            <f:param value="#{motorBookListBean.pageInfo.totalPages}" />
                        </h:outputFormat>
                    </h:panelGrid>
                </h:panelGrid>
            </h:panelGrid>
        </h:form>
   
            </ui:define>
        </ui:composition>
    </body>
</html>